package org.pearl.storage.controller;


import com.hnmqet.demo03.service.StorageTccService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author td
 * @since 2020-01-07
 */
@RestController
@RequestMapping
public class StorageTblController {

    @Autowired
    StorageTccService storageTccService;

    /**
     * 扣减库存
     *
     * @param count
     * @return
     */
    @GetMapping(value = "/storage/tcc")
    void tcc(@RequestParam("code") String code, @RequestParam("count") Long count) {
        storageTccService.reduceStorage(code, count);
    }

}

